<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>18-v-for循环</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
      .box {
        width: 100px;
        height: 100px;
        border: 1px solid red;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <ul>
        <li v-for="(item, index ) in arr" :key="index">{{item}}</li>
      </ul>

      <ol>
        <li v-for="item in obj" :key="item.id">
          <div>
            <span>ID是：{{item.id}} - </span>
            <span>姓名是：{{item.name}} - </span>
            <span>年龄是：{{item.age}} </span>
          </div>
        </li>
      </ol>
    </div>
    <script>
      var vm = new Vue({
        el: '#app',
        data: {
          arr: ['apple', 'banana', 'orange'],
          obj: [
            {
              id: 1,
              name: 'zs',
              age: 12,
            },
            {
              id: 2,
              name: 'ls',
              age: 16,
            },
          ],
        },
        methods: {},
      });
    </script>
  </body>
</html>
